package hw_10apr2014;

import java.util.Scanner;

public class hw1_calc {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		System.out.println("Enter string");
		String s = sc.nextLine();
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '+') {
				Integer y = Integer.valueOf(s.substring(0, i));
				Integer x = Integer.valueOf(s.substring(i + 1, s.length()));
				System.out.println(x + y);
			}
			if (s.charAt(i) == '-') {
				Integer y = Integer.valueOf(s.substring(0, i));
				Integer x = Integer.valueOf(s.substring(i + 1, s.length()));
				System.out.println(y - x);
			}
			if (s.charAt(i) == '*') {
				Integer y = Integer.valueOf(s.substring(0, i));
				Integer x = Integer.valueOf(s.substring(i + 1, s.length()));
				System.out.println(x * y);
			}
			if (s.charAt(i) == '/') {
				Integer y = Integer.valueOf(s.substring(0, i));
				Integer x = Integer.valueOf(s.substring(i + 1, s.length()));
				System.out.println(y / x);
			}
		}
		sc.close();
	}
}
